<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script>
  $("#openRegister").on('click',function(){
    register=layer.open({
      title:'添加诊断',
      type: 1,
      area: ['40%', '55%'],
      content: $("#regResult"),
      btn: ['确定', '取消'],
      yes:function(index,layero){
        butType();
      }
    });
  })


  function butType(){
    if ($('#inputForm').parsley().validate()) {
      $.ajax({
        type: "POST",
        data:$("#inputForm").serialize(),
        url: "${ctx}/doctor/hisDiagnosis/save?clinicId="+$('#clinicIdVal').val(),
        dataType: "json",
        success: function (data) {
          toastr.success(data.data);
          layer.close(register);
          loadDiv('tableDiv','${ctx}/doctor/clinicRecord/clinicRecordIndex?clinicId='+$('#clinicIdVal').val())
          $('#inputForm')[0].reset();
        },
        error: function (data) {
          toastr.error('网络连接错误,请检查网络');
        }
      });
    }
    return false;
  }
</script>
<div class="col-sm-12" id="tableDiv">
  <table id="contentTable" class="table table-bordered mg-t datatable">
    <thead>
    <tr bgcolor="#eaecf6">
      <th width="10%">诊断类型</th>
      <th>诊断名称</th>
      <th>诊断时间</th>
      <th>诊断医生</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${list}" var="hisDiagnosis" >
      <tr>
         <td>${fns:getDictLabels(hisDiagnosis.type,'DIAGNOSIS' ,'' )}</td>
        <td>${hisDiagnosis.icdName}</td>
        <td><fmt:formatDate value="${hisDiagnosis.createDate}" pattern="yyyy-MM-dd HH:mm:ss"/></td>
        <td>${hisDiagnosis.diagnosisDoctor}</td>
      </tr>
    </c:forEach>
    </tbody>
  </table>
  <div class="btn-rigth"><button id="openRegister" type="button" class="btn btn-success">新增</button></div>
</div>